<template>
    <div style="width: 100%;height: 100%;">
        <component :is="customer" :extraColumns="extraColumns" :isCite="true" isShowTag="true" @operaStartupHandleEmit="operaHandle" />
        <!-- 设置开机次数 -->
        <setDevDialog ref="setDevDialogRef" :customerRow="customerRow"></setDevDialog>
    </div>
</template>

<script setup>
import { ref, onMounted, getCurrentInstance, watch, onUnmounted, computed, onBeforeUnmount, defineProps } from '@vue/composition-api'
import config from "@/js/conf/Config.js"
import setDevDialog from '@/pages/device/components/setDevDialog.vue'
// 获取当前组件实例
const { proxy } = getCurrentInstance()

import customer from 'pages/customerV3/customer/index.vue'
// 操作栏目
const extraColumns = ref([
    {
        label: '序号',
        type: 'index',
        width: 60,
        align: 'center',
        indexMethod: (index) => index + 1
    },
    { label: '用户名称', prop: 'name', slot: 'name' },
    { label: '电话号码', prop: 'cellphone',width:'260px'},
    {
        label: '设置开机次数',
        prop: 'operationStartup',
        slot: 'operationStartup',
        width: 150,
        align: 'center'
    }])

const customerRow = ref({})
const setDevDialogRef = ref(null)
const operaHandle = (e) => {
    console.log("eeee", e)
    customerRow.value = e
    setDevDialogRef.value.open()
}

onMounted(() => { })
// 组件销毁时清除数据
onBeforeUnmount(() => { })
onUnmounted(() => { })
defineExpose({})

</script>

<style lang="scss" scoped>
.dialog-content {
    display: flex;
    flex-direction: column;
    height: 500px;

    &-header {
        margin-bottom: 10px;
    }

    &-body {
        flex: 1 1 auto;
        overflow: auto;
    }

    &-footer {
        margin: 20px 0 10px 0;
    }
}
</style>